<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles-extras" prefix="tilesx" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <spring:message code="error404_txt" var="error404_txt"/>
    <spring:message code="menu.destination_lbl" var="destination_lbl"/>
    <spring:message code="menu.predefined_lbl" var="predefined_lbl"/>
    <spring:message code="menu.login_lbl" var="login_lbl"/>
    <spring:message code="menu.myprofile_lbl" var="myprofile_lbl"/>
    <spring:message code="menu.logout_lbl" var="logout_lbl"/>


    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="shortcut icon" type="image/x-icon" href="<c:url value="/img/favicon.ico"/>" />
        <link rel="stylesheet" href="<c:url value="/css/bootstrap/bootstrap.css"/>" type="text/css" />
        <link rel="stylesheet" href="<c:url value="/css/kendo/kendo.bootstrap.min.css"/>" type="text/css" />
        <link rel="stylesheet" href="<c:url value="/css/kendo/kendo.common-bootstrap.min.css"/>" type="text/css" />
        <link rel="stylesheet" href="<c:url value="/css/kendo/kendo.common-bootstrap.core.min.css"/>" type="text/css" />
        <script src="<c:url value="/js/jquery-2.1.1.min.js"/>"></script>
        <script src="<c:url value="/js/bootstrap.min.js"/>"></script>
        <script src="<c:url value="/js/kendo/kendo.ui.core.min.js"/>"></script>

        <link rel="stylesheet" href="<c:url value="/css/site.css"/>" type="text/css" />
        <title>Reisburito</title>
    </head>

    <script type="text/javascript">
                // When the page is being loaded, the cookie for currency needs to be set.
                window.document.onload = checkBeginCookie();
                // To begin with, the currency cookie needs to be set otherwise a 400 error will pop-up
                        function checkBeginCookie() {
                        if (document.cookie.indexOf("currency=") === - 1) {
                        document.cookie = "currency=EUR-8364";
                        }
                        }

                // With this function, several cookies can be set
                function setCookie(cname, cvalue) {
                if (document.cookie !== null) {
                document.cookie = cname + "=";
                }
                document.cookie = cname + "=" + cvalue;
                        window.location.reload();
                }
    </script>

    <script language="text/javascript">
                if ((document.cookie = "currency=.*") = false) {
                window.document.onload = document.cookie = "currency=EUR-8364";
                }
    </script>
    <body>
        <div id='header'>
            <div class="col-md-11">
                <div class="iconsGroup">
                    <a href="#" onclick=setCookie("language", "nl")> <img src="<c:url value="/img/Icon_NL.png"/>" alt="Nederlands" title="Nederlands" class="languageIcon"/></a>
                    <a href="#" onclick=setCookie("language", "en")><img src="<c:url value="/img/Icon_EN.png"/>" alt="English" title="English" class="languageIcon"/></a>
                </div>
                <div class="iconsGroup">
                    <a href="#" onclick=setCookie("currency", "EUR-8364")><img src="<c:url value="/img/euro.png"/>" alt="Euro" title="Euro" class="languageIcon"/></a>
                    <a href="#" onclick=setCookie("currency", "GBP-163")><img src="<c:url value="/img/pound.png"/>" alt="British Pounds" title="British Pounds" class="languageIcon"/></a>
                    <a href="#" onclick=setCookie("currency", "USD-36")><img src="<c:url value="/img/dollar.png"/>" alt="Dollar" title="Dollar" class="languageIcon"/></a>
                    <a href="#" onclick=setCookie("currency", "JPY-165")><img src="<c:url value="/img/yen.png"/>" alt="Yen" title="Yen" class="languageIcon"/></a>
                </div>
            </div>
        </div>
        <div id='menu'>
            <nav id="menu-nav" class="navbar navbar-default" role="navigation">
                <div class="container-fluid">
                    <div class="pull-left">
                        <img src="<c:url value="/img/Reisburrito.png"/>" class="reisburritologo_menu"/>
                    </div>
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="${currentMenuTab == 'index' ? 'active' : ''}"><a href="<c:url value="/index"/>">Home</a></li>
                            <li class="${currentMenuTab == 'trip' ? 'active' : ''}"><a href="<c:url value="/trip/index"/>">${predefined_lbl}</a></li>
                                <sec:authorize access="!hasRole('klant')">
                                <li class="${currentMenuTab == 'login' ? 'active' : ''}"><a href="<c:url value="/loginPage"/>">${login_lbl}</a></li>
                                </sec:authorize>
                                <sec:authorize access="hasRole('klant')">
                                    <sec:authorize access="!hasRole('admin')">
                                    <li class="${currentMenuTab == 'customer' ? 'active' : ''}"><a href="<c:url value="/customer/edit"/>">${myprofile_lbl}</a></li>
                                    </sec:authorize>
                                <li class="${currentMenuTab == 'logout' ? 'active' : ''}"><a href="<c:url value="/logout"/>">${logout_lbl}</a></li>
                                </sec:authorize>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <div id='bodySpacer'></div>      
        <div id='body' class='container-fluid'>
            <div id='content' class='col-centered'>
                <div class="col-md-6 col-centered" style="text-align: center">
               <!--<img src="<c:url value="/img/Reisburrito.png"/>" class="logoreisburrito center-block" style="width: 350px;"/>-->  
<!--                <h3>${error404_txt}</h3>-->
                    
                    <img src="<c:url value="/img/500.jpg"/>" class="logo center-block"/>
                    <h5>We're terribly sorry for this!</h5>
                </div>
            </div> 
        </div>

    </body>
</html>
